Optimal. Leaf size=170 \[ \frac {2^{m+\frac {1}{2}} \left (A \left (m^2+3 m+2\right )+C \left (m^2+m+1\right )\right ) \sin (e+f x) (\cos (e+f x)+1)^{-m-\frac {1}{2}} (a \cos (e+f x)+a)^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right )}{f (m+1) (m+2)}-\frac {C \sin (e+f x) (a \cos (e+f x)+a)^m}{f \left (m^2+3 m+2\right )}+\frac {C \sin (e+f x) (a \cos (e+f x)+a)^{m+1}}{a f (m+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.160, Rules used = {3024, 2751, 2652, 2651} \[ \frac {2^{m+\frac {1}{2}} \left (A \left (m^2+3 m+2\right )+C \left (m^2+m+1\right )\right ) \sin (e+f x) (\cos (e+f x)+1)^{-m-\frac {1}{2}} (a \cos (e+f x)+a)^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right )}{f (m+1) (m+2)}-\frac {C \sin (e+f x) (a \cos (e+f x)+a)^m}{f \left (m^2+3 m+2\right )}+\frac {C \sin (e+f x) (a \cos (e+f x)+a)^{m+1}}{a f (m+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2651
Rule 2652
Rule 2751
Rule 3024
Rubi steps
\begin {align*} \int (a+a \cos (e+f x))^m \left (A+C \cos ^2(e+f x)\right ) \, dx &=\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\int (a+a \cos (e+f x))^m (a (C (1+m)+A (2+m))-a C \cos (e+f x)) \, dx}{a (2+m)}\\ &=-\frac {C (a+a \cos (e+f x))^m \sin (e+f x)}{f \left (2+3 m+m^2\right )}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) \int (a+a \cos (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=-\frac {C (a+a \cos (e+f x))^m \sin (e+f x)}{f \left (2+3 m+m^2\right )}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\left (\left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\cos (e+f x))^{-m} (a+a \cos (e+f x))^m\right ) \int (1+\cos (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=-\frac {C (a+a \cos (e+f x))^m \sin (e+f x)}{f \left (2+3 m+m^2\right )}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {2^{\frac {1}{2}+m} \left (C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\cos (e+f x))^{-\frac {1}{2}-m} (a+a \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right ) \sin (e+f x)}{f (1+m) (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 1.54, size = 242, normalized size = 1.42 \[ \frac {i 4^{-m-1} \left (1+e^{i (e+f x)}\right ) e^{-i (m+2) (e+f x)} \left (e^{-\frac {1}{2} i (e+f x)} \left (1+e^{i (e+f x)}\right )\right )^{2 m} \cos ^{-2 m}\left (\frac {1}{2} (e+f x)\right ) (a (\cos (e+f x)+1))^m \left ((m+2) e^{i (m+2) (e+f x)} \left (2 (m-2) (2 A+C) \, _2F_1\left (1,m+1;1-m;-e^{i (e+f x)}\right )+C m e^{2 i (e+f x)} \, _2F_1\left (1,m+3;3-m;-e^{i (e+f x)}\right )\right )+C (m-2) m e^{i m (e+f x)} \, _2F_1\left (1,m-1;-m-1;-e^{i (e+f x)}\right )\right )}{f (m-2) m (m+2)} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 0.46, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (C \cos \left (f x + e\right )^{2} + A\right )} {\left (a \cos \left (f x + e\right ) + a\right )}^{m}, x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (f x + e\right )^{2} + A\right )} {\left (a \cos \left (f x + e\right ) + a\right )}^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.48, size = 0, normalized size = 0.00 \[ \int \left (a +a \cos \left (f x +e \right )\right )^{m} \left (A +C \left (\cos ^{2}\left (f x +e \right )\right )\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (C \cos \left (f x + e\right )^{2} + A\right )} {\left (a \cos \left (f x + e\right ) + a\right )}^{m}\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int \left (C\,{\cos \left (e+f\,x\right )}^2+A\right )\,{\left (a+a\,\cos \left (e+f\,x\right )\right )}^m \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \left (\cos {\left (e + f x \right )} + 1\right )\right )^{m} \left (A + C \cos ^{2}{\left (e + f x \right )}\right )\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________